package org.springblade.modules.admin.vo.platform;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.modules.admin.enums.ApplicationStatusEnum;

import java.util.List;

/**
 * @author zcc
 * @version 1.0
 * @date 2022/5/31 9:44
 */
@ApiModel("项目申请model")
@Data
public class ApplicationFormVO {

	private Long id;

	private List<String> buildingNames;

	private List<String> highlightBuildingNames;

	private List<String> highlightElevatorNames;

	private List<FormBuildingInfoVo> buildingAndElevatorNames;

	private Integer buildingCounts;

	private Integer elevatorCounts;

	@ApiModelProperty(value = "来源类型 0-平台, 1-维保租户, 2-物业租户")
	private Integer sourceType;

	@ApiModelProperty("创建来源名称")
	private String sourceTypeName;

	@ApiModelProperty("租户ID")
	private String tenantId;

	@ApiModelProperty("租户ID")
	private String tenantName;

	@ApiModelProperty(value = "申请人名称")
	private String applicantName;

	@ApiModelProperty(value = "申请人电话")
	private String applicantPhone;

	private String updateName;

	private String updateTime;

	private String createTime;

	private Integer status;

	private String statusName;

	public void setStatus(Integer status) {
		this.status = status;
		this.statusName = ApplicationStatusEnum.getName(status);
	}

	public void setSourceType(Integer sourceType) {
		this.sourceType = sourceType;
		if (sourceType != null) {
			if (sourceType == 0) {
				this.sourceTypeName = "平台";
			} else if (sourceType == 1) {
				this.sourceTypeName = "维保租户";
			} else if (sourceType == 2) {
				this.sourceTypeName = "物业租户";
			}
		}
	}
}
